|
|
@@ -190,6 +190,8 @@ module Agents
|
190
|
190
|
end
|
191
|
191
|
|
192
|
192
|
def latest_events(reload = false)
|
|
193
|
+ received_events = received_events().reorder(id: :asc)
|
|
194
|
+
|
193
|
195
|
events =
|
194
|
196
|
if (event_ids = memory[:event_ids]) &&
|
195
|
197
|
memory[:events_order] == events_order &&
|
|
|
@@ -207,8 +209,7 @@ module Agents
|
207
|
209
|
|
208
|
210
|
new_events =
|
209
|
211
|
if last_event_id = memory[:last_event_id]
|
210
|
|
- received_events.where(Event.arel_table[:id].gt(last_event_id)).
|
211
|
|
- order(id: :asc).to_a
|
|
212
|
+ received_events.where(Event.arel_table[:id].gt(last_event_id)).to_a
|
212
|
213
|
else
|
213
|
214
|
source_ids.flat_map { |source_id|
|
214
|
215
|
# dig twice as many events as the number of
|